package com.bsoft.gol.editor.init;

import com.bsoft.gol.editor.filter.EditorRestUserTokenFilter;
import org.springframework.stereotype.Component;
import org.springframework.web.WebApplicationInitializer;

import javax.servlet.ServletContext;
import javax.servlet.ServletException;

/**
 * 升级springboot后废弃 请使用FilterConfig
 *
 * @author neoLin - 2022/06/13 14:18
 **/

public class FilterInitializer implements WebApplicationInitializer {

    public FilterInitializer() {
    }

    @Override
    public void onStartup(ServletContext servletContext) throws ServletException {

        servletContext.addFilter("restUserTokenFilter", EditorRestUserTokenFilter.class).addMappingForUrlPatterns(null, false, "**/api/auth/editorFormQr/list","**/api/auth/editorQuestionnaire/add","**/api/auth/editorQuestionnaire/updatetype","**/api/auth/editorQuestionnaire/list");
    }



}
